Feature: User registers their personal data
  In order to get access to use voting application
  As a user
  I want to register myself become a member of the voting application

@user_register
Scenario: User register with a valid data
    Given I am on "the homepage"
    When I follow "Sign Up"
    Then I should see "Registration" form
    And I fill in "user_firstname" with "james"
    And I fill in "user_lastname" with "sarumaha"
    And I fill in "user_surname" with "kachiro"
    And I fill in "user_login" with "james"
    And I fill in "user_email" with "sarumaha_1@yahoo.com"
    And I fill in "user_password" with "james"
    And I fill in "user_password_confirmation" with "james"
    When I press "Register"
    Then I should see "Thanks for register, please login to start the application"

Scenario: User register with a invalid data
    Given I am on the "the homepage"
    When I follow "Sign Up"
    Then I should see "Registration" form
    And I fill in "user_firstname" with ""
    And I fill in "user_lastname" with ""
    And I fill in "user_surname" with "zxz"
    And I fill in "user_login" with "james"
    And I fill in "user_email" with "sarumaha_1@yahoo.com"
    And I fill in "user_password" with "james"
    And I fill in "user_password_confirmation" with "james"
    When I press "Register"
    Then I should see "2 errors prohibited this user from being savedThere were problems with the following fields:Lastname can't be blankFirstname can't be blank"